package com.alex.springboot.controller;

import com.alex.springboot.config.LucyProperties;
import com.alex.springboot.config.My;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private LucyProperties lucyProperties;

    @Autowired
    private My my;

    @GetMapping("/hello")
    public String hello() {
        return "hello world!";
    }

    @GetMapping("/lucy")
    public LucyProperties lucy() {
        return lucyProperties;
    }

    @GetMapping("/my")
    public My my() {
        System.out.println("my...");
        return my;
    }

}
